<template>
  <el-tree-select
    v-model="selectedValue"
    :data="props.options"
    :props="{
      value: 'deptId',
      label: 'deptName',
      children: 'children'
    }"
    :check-strictly="true"
    placeholder="请选择"
    filterable
    style="width: 100%"
  ></el-tree-select>
</template>

<script setup>
import { ref, onMounted, watch, computed } from 'vue'
import { deptTreeInfoAll } from '@/api/systemSetting/personnel'

const props = defineProps(['modelValue', 'options'])
const emits = defineEmits(['update:modelValue'])

// 初始化数据
const options = ref([])
const allData = ref([])
const selectedValue = ref(null)

watch(
  () => props.modelValue,
  (val) => {
    selectedValue.value = val
  }
)
watch(
  () => selectedValue.value,
  (val) => {
    emits('update:modelValue', val)
  }
)
</script>

<style scoped lang="scss"></style>
